const http = require("http")
const url = require("url")
let server = http.createServer((req, res) => {
    // console.log(req)
    if (req.method == "GET") {
        console.log("get请求")
        console.log(req.url)
        const paramsObj = url.parse(req.url, true)
        console.log(paramsObj.query.name)
    } else {
        console.log("非get请求")
    }
    res.end("hello!")
})
server.listen(3000, () => {
    console.log("服务器已启动")
})